import os
import copy

BIN_DIR=os.environ['BIN_DIR'];
LIB_DIR=os.environ['LIB_DIR'];

sources= [
  "jerry-all-in.c"
]

env=DefaultEnvironment().Clone()

env['CCFLAGS'] = env['CCFLAGS'] + ' -DJERRY_ES2015=0 -DJERRY_GLOBAL_HEAP_SIZE=2048 -DJERRY_CPOINTER_32_BIT -DJERRY_DEBUGGER=1 -DJERRY_ERROR_MESSAGES=1 -DJERRY_LOGGING=1 -DJERRY_COMMIT_HASH=\\\"\\\"';

os.environ['WITH_JS'] = 'true'
if 'WITH_JS' in os.environ:
  env.Library(os.path.join(LIB_DIR, 'jerryscript'), sources)
  sources=["jerryscript/jerry-main/main-jerry.c", "jerryscript/jerry-main/main-utils.c", "jerryscript/jerry-main/main-options.c", "jerryscript/jerry-main/cli.c"]
  env.Program(os.path.join(BIN_DIR, 'jerry'), sources)
